<?php
class BottomMethod extends RestMethod {
	function runInternal() {
		$criteria = new CDbCriteria();
		$criteria->order = 'id ASC';
		$models = BottomContent::model()->findAll($criteria);
		$c = Yii::app();
		$blink = array();
		foreach($models as $one) {
			$link = $c->createUrl('/help/bottomView', array('id'=>$one->id));
			$blink[] = "<a href='$link'>{$one->title}</a>";
		}
		$blink = implode('|', $blink);
		$appName = Yii::app()->name;
		$icp = Yii::app()->params['icp'];
		$copyright = "{$appName} 版权所有 备案号：{$icp}";
		return $this->render($blink, $copyright);
	}
	
	
	protected function render($blink, $copyright) {
		$template = <<<EOD
<div id='ly-footer'>
	<div class='ly-b-link'>
		{$blink}
	</div>
	<div class="ly-copyright">
		<p>{$copyright}</p>
	</div>
</div>

EOD;
		return $template;
	}
	
}